package com.mall.seckill.service;

import com.github.pagehelper.PageInfo;
import com.mall.common.response.CommonResponse;
import com.mall.entity.TbGoodsEvaluate;
import com.mall.entity.TbSeckillItem;
import com.mall.seckill.entity.vo.SeckillItemVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * iseckill项目服务
 * created with IntelliJ IDEA
 *
 * @author ASUS
 * @Date: 2021/07/18/9:13
 * Other:
 */
public interface ISeckillItemService {

    public  void addSeckillToRedis();
    /**
     * 找到所有
     *
     * @param seckillItem 秒杀商品
     * @param pageNum     页面num
     * @param pageSize    页面大小
     * @return {@link PageInfo}
     */
    PageInfo findAll(TbSeckillItem seckillItem, int pageNum, int pageSize);

    /**
     * 找到秒杀名单
     *
     * @param time 时间
     * @return {@link List<SeckillItemVo>}
     */
    List<SeckillItemVo> findSeckillList(String time);

    /**
     * 做秒杀
     *
     * @param uid     uid
     * @param id      id
     * @return {@link CommonResponse}
     */
    CommonResponse doSeckill(Long uid, Long id);

    /**
     * 发现商品评价
     *
     * @param id id
     * @return {@link List<TbGoodsEvaluate>}
     */
    List<TbGoodsEvaluate> findGoodsEvaluate(Integer id);

    /**
     * 添加汽车
     *
     * @param uid uid
     * @param id  id
     * @return {@link CommonResponse}
     */
    CommonResponse addCar(Integer uid,Integer id);

    /**
     * 加秒杀商品
     *
     * @param seckillItemVo 秒杀商品签证官
     * @return {@link Boolean}
     */
    Boolean addSeckillItem(SeckillItemVo seckillItemVo);


    /**
     *
     * @param tbSeckillItem
     * @return
     */
    Boolean update(TbSeckillItem tbSeckillItem);

    TbSeckillItem findById(Long id);
}
